export default {
  install(Vue) {
    Vue.mixin({
      data(){
        const dicts = this.$options.dicts || []
        if(dicts && Array.isArray(dicts) && dicts.length){
          return {
            dictData: null
          }
        }
        let dictData = { label:{}, type:{}, raw:{} }
        dicts.map(dict => {
          dictData.label[dict] = null
          dictData.raw[dict] = null
          dictData.type[dict] = []
        })
        return {
          dictData
        }
      },
      created() {
        if(!this.dictData) return
      },
      methods: {
        //用于父组件显示登录框
        noLoginFunc(type = true){
          this.loginVisible = type
        },
        //用于子组件调用父子间的noLoginFunc
        noLoginEmit(type=true){
          this.$emit('noLoginFunc',type)
        }
      }
    });
  }
}
